<!-- Web Upload Search Result PHP File -->
<!-- Reveions History ...
	Rev 1.00 at guangshui_xu 
	查询表delrecord 的内容,并显示在html页面
-->
<html>
	<body background="pic/background_06.gif">
	<head>	
		<font face="新細明體,time new roman,Arial">
		<meta charset="UTF-8">
	</head>
	<body>
		<center>
			<font size="5" color="#0000FF"><b>--- 删除记录,查询结果 ---</b></font><br>
			<hr>
			<?php

				require_once('class_package/common.php');//调用数据库链接	
				
				$del_username	= trim($_POST['del_username']);
				$partnum	= trim($_POST['partnum']);

				$db_select      = DeleteRecord::sql_db;//选择数据库，
				$db_table       = DeleteRecord::sql_table;//选择表，
	
				
				$conn = mysqli_connect(html::sql_login_host,html::sql_login_user,html::sql_login_pass,$db_select);
				if ( mysqli_connect_errno($conn) ) { 
					echo "<script>alert('MySQL资料库连接错误, 请联系统开发人员!!');history.go(-1);</script>";
					exit();
				}
				
				mysqli_set_charset($conn,'set names utf8');
				// $sqli_cmd = "SELECT * FROM  delrecord  ORDER BY deleteTime DESC";
				$sqli_cmd = "SELECT * FROM  delrecord WHERE `pn` LIKE '%$partnum%' AND `deleteUser` LIKE '%$del_username%' ORDER BY deleteTime DESC LIMIT 0,200";
				$res = mysqli_query($conn,$sqli_cmd);	// 透过 execute_query 对象实例完成查询
				if ( !$res ) { 
					mysqli_close($conn);				// 关闭资料库
					echo "<script>alert('MySQL资料库查询错误, 请联系统开发人员!!');history.go(-1);</script>";
					exit();
				}
				echo' <br>
				<table border="2" width="75%">
					<tr bgcolor="#70DB93">
						<th>No.</th>
						<th>PN</th>
						<th>工單</th>
						<th>TPVER</th>
						<th>wsid</th>
						<th>Create By</th>
						<th>deleteUser</th>
						<th>Delete Date/Time</th>
						<th>FTP_FILE_STATUS</th>
					</tr>';
				$show_num		= 0;	
				$row = mysqli_num_rows($res);		// 返回结果集中栏位的数量。
				if ( $row > 0 ) {	//将读到的数据放到定义好的变量中，待用													
					while ( $getArrays = mysqli_fetch_array($res,MYSQLI_ASSOC) ) {									
					$show_num++;
					$put_pn          	= $getArrays['pn'];
					$put_gongdan    	= $getArrays['work_order'];
					$put_tpver       	= $getArrays['tpver'];
					$put_wsid  			= $getArrays['wsid'];
					$put_createUser    	= $getArrays['creator'];
					$put_deleteUser 	= $getArrays['deleteUser'];
					$put_deleteTime 	= $getArrays['deleteTime'];
					$ftp_file  			= $getArrays['ftp_file'];
					echo "
						<tr>
							<th>$show_num</th>
							<th>$put_pn</th>
							<th>$put_gongdan</th>
							<th>$put_tpver</th>
							<th>$put_wsid</th>
							<th>$put_createUser</th>
							<th>$put_deleteUser</th>
							<th>$put_deleteTime</th>
							<th>$ftp_file</th>
						</tr>";
					}
				}				
				echo '</table><br>';
				mysqli_free_result($res);			// 释放 MySQL $result
				mysqli_close($conn);					// 关闭资料库						
			?>
		</center>
	</body>
</html>